package com.example.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.entity.Author;
import com.example.demo.entity.Poetry;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AuthorMapper extends BaseMapper<Author> {

    @Select("select name from lv_writing_authors order by id asc LIMIT 20")
    List<String> getInitAuthorInfo();

    @Select("select * from lv_writing_authors ORDER BY RAND() LIMIT 1")
    Author getRandomAuthor();

}
